/*
 * @Author: DUST
 * @Date: 2023-05-26 11:41:47
 * @LastEditors: DUST
 * @LastEditTime: 2023-05-27 17:07:03
 * @FilePath: \koa-node-ts\app\controller\IndexCOntroller.ts
 * @Description:
 * undefined
 */

import { Context } from "koa";
import UserService from "../service/UserService";
import responseData from "../../utils/responese";

class IndexController {
  async index(ctx: Context) {
    const user = await UserService.getAdminById(10);
    if(user === null) return responseData.errorResponese(ctx, "用户不存在", 404)
    else responseData.success(ctx, user);
  }
}

export default new IndexController();
